#include "GameOverMenu.h"
#include "Utilities.h"
#include "PrintUtilities.h"
#include "MenuManager.h"
#include "UserManager.h"
#include "ServiceProvider.h"

GameOverMenu::GameOverMenu(MenuManager* const i_menuManager)
	: Menu(i_menuManager)
{
}

void GameOverMenu::Draw() const
{
	std::cout << Print::Title(" GAME OVER ") << std::endl << std::endl;
	
	for (size_t i=0; i<GetSP()->GetUserMgr().m_gameoverNames.size();++i)
		std::cout << GetSP()->GetUserMgr().m_gameoverNames.at(i) << std::endl;

	std::cout << Print::Options(" 0) Return to Main Menu.") << " Selection: ";
}


bool GameOverMenu::Input(const std::string& i_input)
{
	bool goodInput = true;

	int res = Utilities::StringToInt(i_input);

	if (res == 0) 
		GetMM()->PopMenu();
	else
		goodInput=false;

	return goodInput;
}